/*
package com.xiaopan.business.blog.config;

import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.support.XmlWebApplicationContext;
import org.springframework.web.filter.CharacterEncodingFilter;
import org.springframework.web.servlet.DispatcherServlet;
import org.springframework.web.util.IntrospectorCleanupListener;
import org.springframework.web.util.Log4jConfigListener;

import javax.servlet.*;
import java.util.EnumSet;

*/
/**
 * Spring与Web配置
 *
 * @author pan_zpeng
 * @data 2017-07-29
 *//*

public class SpringContextInitializer implements WebApplicationInitializer {
    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {
        servletContext.setInitParameter("contextConfigLocation", "classpath:spring/app-context.xml");
        servletContext.addListener(ContextLoaderListener.class);
        //Log4jConfigListener
        servletContext.setInitParameter("log4jConfigLocation", "classpath:log4j.xml");
        servletContext.addListener(Log4jConfigListener.class);
        servletContext.addListener(IntrospectorCleanupListener.class);
        // Live Filter
*/
/*        FilterRegistration.Dynamic liveFilter = servletContext.addFilter("LiveFilter", new LiveFilter());
        liveFilter.setAsyncSupported(true);
        liveFilter.addMappingForUrlPatterns(EnumSet.noneOf(DispatcherType.class), false, "/live.jsp");*//*

        // Encoding Filter
        FilterRegistration.Dynamic encodingFilter = servletContext.addFilter("CharacterEncoding", new CharacterEncodingFilter());
        encodingFilter.setInitParameter("encoding", "UTF-8");
        encodingFilter.setInitParameter("forceEncoding", "true");
        encodingFilter.addMappingForUrlPatterns(EnumSet.noneOf(DispatcherType.class), false, "*/
/*");
        // Auth Filter
*/
/*        FilterRegistration.Dynamic authFilter = servletContext.addFilter("AuthFilter", new AuthFilter());
        authFilter.addMappingForUrlPatterns(EnumSet.noneOf(DispatcherType.class), false, "*//*
*/
/*");*//*

        // Dispatcher Servlet
        XmlWebApplicationContext appContext = new XmlWebApplicationContext();
        appContext.setConfigLocation("classpath:spring/spring-mvc.xml");
        ServletRegistration.Dynamic dispatcher = servletContext.addServlet("dispatcher", new DispatcherServlet(appContext));
        dispatcher.setLoadOnStartup(1);
        dispatcher.addMapping("/");
    }
}
*/
